<template>
	<view class="content">
		<view class="main">
			<navgit :navigationMsg="navigationMsg"></navgit>
			<view class="sm_top">
				<view class="sm_imgs">
					<p style="text-align: center;font-size: 45rpx;margin-top: 300rpx;">人脸实名认证</p>
				</view>
				<view class="sm_top_title">
					<p style="text-align: center;">根据实名制下单要求，使用信用免押服务前你需要通过
						实名认证，并授权如下信息</p>
				</view>
			</view>
			<view class="sm_text">
				<view class="text_tops">
					<image src="/static/警告.png" style="width: 40rpx;height: 40rpx;margin-top: 24rpx;margin-left: 20rpx;"
						mode=""></image>
					<p style="font-size: 25rpx;line-height: 90rpx;margin-left: 10rpx;color: #F9D23A;">
						姓名和身份证号需与当前支付宝认证信息一致</p>
				</view>
				<view class="text_ipt">
					<view class="list_user">
						<p>姓名</p>
					</view>
					<input class="list_useript" type="text" v-model="user" style="" />
				</view>
				<view class="text_ipt">
					<view class="list_user">
						<p>身份证号</p>
					</view>
					<input class="list_useript" type="text" v-model="idcurd" style="" @blur="onburs" />
				</view>
				<view class="text_ipt">
					
					
					<!-- <u-input style="width: 200rpx;height: 200rpx;" v-model="value" :type="type" :border="border" /> -->
					<!-- <u-upload ref="uUpload" :action="action" :auto-upload="false" ></u-upload> -->
					<!-- <u-button @click="submit">提交</u-button> -->
					<u-button @click="upLoadImg" class="u_btn" text="进入人脸认证"></u-button>
					
				</view>
				

			</view>
			<image :src="this.images" mode=""></image>
		</view>
	</view>
</template>

<script>
	import {
		upload_card
	} from "../../../api/api.js"
	import navgit from "../../../common/navgats/navgats.vue"
	export default {
		data() {
			return {
				value: '',
				type: 'file',
				border: true,
				navigationMsg: {
					title: "实名认证",
					bgColor: "#FCE847"
				},
				user: "",
				idcurd: "",
				videoSrc: '',
				images:""
			}
		},
		components: {
			navgit
		},
		mounted() {
		
		},

		methods: {
			// async upLoadImg(){
			//     const that = this;
			//     uni.chooseImage({
			//         sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
			//         sourceType: ['album'], //从相册选择
			//         success: (res)=>{
			//             console.log(res.tempFilePaths,"本地路径")
						
			// 			let blob = new Blob(res.tempFilePaths, { type:'image/png' }); 
			// 			let url = URL.createObjectURL(blob); // 转化为路径
			// 			       const str = url;
			// 			console.log(str,"str")
			// 			console.log(res.tempFiles[0],"ressss")
			// 			this.images=res.tempFiles[0]
			// 			this.updatys()
			//             for(let i=0; i<res.tempFilePaths.length;i++){  //多次调用上传接口，一张一张传  
											
			// 				that.images=res.tempFilePaths[i]
							
			// 				// console.log(that.images)
			// 				console.log(res.tempFilePaths[i])
			//                 // uni.uploadFile({
			//                 //     // url: 'https://api.jingkakeji.com/api/user/upload_card',//你的接口地址  需修改
			//                 //     filePath: res.tempFilePaths[i],//上传返回的文件本地路径 无需修改
			//                 //     fileType: 'image',//文件类型 上传图片的话无需动
			//                 //     name: 'file',  
			                   
			                   
			//                 // });
			//             }
			//         }
			//     })
			// 	// console.log(that.images,"123214")
				
			// },
		
			upFile(input, event) {
				// console.log( event,"2134214")
				var _self = this;
				uni.uploadFile({
					url: "https://api.jingkakeji.com/api/user/upload_card",
					files: [{
						file: input.files[0],
						uri: event.srcElement.value
					}],
					success: (uploadFileRes) => {
						console.log(uploadFileRes, "111233")
					},
					fail: (err) => {
						console.log(err)
					}
				});
			},

			onburs() {

			},

			onipt() {

				// // console.log(this.user,this.idcurd)

			}
		}
	}
</script>

<style lang="scss" scoped>
	* {
		font-size: 3vw;
		/* white-space: nowrap; */
	}

	.content {
		width: 100vw;
		height: 100vh;
		/* position: absolute; */
		background-color: #F6F6F6;
		overflow-y: auto;
	}

	.main {
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.sm_top {
		width: 100%;
		height: 500rpx;
		background: linear-gradient(#FCE847, #F9F9F9);
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.sm_imgs {
		width: 70%;
		height: 400rpx;
	}

	.sm_top_title {
		width: 70%;
		height: 100rpx;
	}

	.sm_text {
		width: 90%;
		height: 470rpx;
		background-color: #ffffff;
		border-radius: 20rpx;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.text_ipt {
		width: 90%;
		height: 70rpx;
		display: flex;
		margin-top: 40rpx;
	}

	.list_user {
		width: 30%;
		height: 70rpx;
		background-color: #F6F6F6;
		border-radius: 50rpx 0 0 50rpx;
	}

	.list_user p {
		line-height: 70rpx;
		text-align: center;
	}

	.list_useript {
		width: 70%;
		height: 70rpx;
		background-color: #F6F6F6;
		border-radius: 0 50rpx 50rpx 0;
	}

	.u_btn {
		width: 100%;
		height: 70rpx;
		border-radius: 50rpx;
		background: #FBD748;
		border: none;
	}

	.text_tops {
		width: 100%;
		height: 90rpx;
		background-color: #FFFBEC;
		display: flex;
	}
</style>